package com.gomoku;

import java.awt.Color;
import java.awt.Rectangle;
import java.util.ResourceBundle;

// 常量
class Const {
    // 格
    public static final int GRID_SIZE = 40;                                                             // 尺寸
    
    // 游戏区域
    public static final int GAME_BOARD_POINT_COUNT_H = 15;                                              // 横向点数
    public static final int GAME_BOARD_POINT_COUNT_V = 15;                                              // 纵向点数
    public static final int GAME_BOARD_WIDTH = (GAME_BOARD_POINT_COUNT_H + 1) * GRID_SIZE;              // 宽度
    public static final int GAME_BOARD_HEIGHT = (GAME_BOARD_POINT_COUNT_V + 1) * GRID_SIZE;             // 高度
    public static final Color GAME_BOARD_COLOR = new Color(128, 128, 192);                              // 背景色
    public static final Color GAME_BOARD_BORDER_COLOR = Color.BLACK;                                    // 线颜色

    // 棋子
    public static final int PIECE_RADIUS = GRID_SIZE * 4 / 10;                                          // 半径
    
    // 胜利数
    public static final int WIN_NUMBER = 5;                                                             // 达到此数胜利

    // 主窗口
    public static final int WIDTH = 656;                                                                // 宽度
    public static final int HEIGHT = 722;                                                               // 高度
    
    // 对手列表窗口
    public static final int RIVAL_WINDOW_WIDTH = 288;                                                   // 宽度 
    public static final int RIVAL_WINDOW_HEIGHT = 286;                                                  // 高度 
    public static final Rectangle RIVAL_WINDOW_USER_LIST_BOUNDS = new Rectangle(10, 10, 252, 192);      // 位置和尺寸
    public static final Rectangle RIVAL_WINDOW_BUTTON_OK_BOUNDS = new Rectangle(60, 210, 70, 26);       // "确定"按钮的位置和尺寸
    public static final Rectangle RIVAL_WINDOW_BUTTON_CANCEL_BOUNDS = new Rectangle(140, 210, 70, 26);  // "取消"按钮的位置和尺寸

    // 其它
    private static final ResourceBundle RESOURCE = ResourceBundle.getBundle("language_zh_CN");          // 字符串资源
    
    /**
     * 获取字符串。
     * @param id   字符串 id
     * @return 字符串
     */
    public static String getString(String id) {
        return RESOURCE.getString(id);
    }
}
